﻿using Project.Core.Config.Entity;
using Project.Core.Config.Entity.Dto;

namespace Project.Core.Config.Service {
    public interface IService<T, L> where T : BaseEntity<L>
    {
        public List<T> GetAll();
        public Task<List<T>> GetAllAsync();
        public Page GetAll(Page page);
        public T GetById(L id);
        public Task<T> GetByIdAsync(L id);
        public List<T> ListByIds(IEnumerable<L> idList);
        public Task<List<T>> ListByIdsAsync(IEnumerable<L> idList);
        public T Add(T data);
        public Task<T> AddAsync(T data);
        public List<T> AddList(IEnumerable<T> dataList);
        public Task<List<T>> AddListAsync(IEnumerable<T> dataList);
        public T Delete(T data);
        public Task<T> DeleteAsync(T data);
        public T DeleteById(L id);
        public Task<T> DeleteByIdAsync(L id);
        public List<T> DeleteList(IEnumerable<T> dataList);
        public Task<List<T>> DeleteBatchAsync(IEnumerable<T> dataList);
        public List<T> DeleteByIds(IEnumerable<L> idList);
        public Task<List<T>> DeleteBatchIdsAsync(IEnumerable<L> idList);
        public T Update(T updateData);
        public Task<T> UpdateAsync(T updateData);
        public List<T> UpdateList(IEnumerable<T> updateData);
        public Task<List<T>> UpdateListAsync(IEnumerable<T> updateData);

        public Page<T> Page(Page page);
        public Page<E> Page<E>(Page page, IEnumerable<E> list);
    }
}
